package core.domain.messages;

import javax.xml.bind.annotation.XmlRootElement;

import core.domain.Torrent;

@XmlRootElement
public class DisconnectionMessage extends AbstractMessage {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -560040855728515822L;

	protected DisconnectionMessage() {
		super(MessageType.DISCONNECTION);
	}

	public DisconnectionMessage(Torrent torrent){
		this();
		this.torrent = torrent;
	}
	
	/**
	 * optional parameter: if specified, the peer will be removed only from this torrent.
	 * if not specified, then peer will be removed from all torrent it seeds.
	 */
	private Torrent torrent = null;
	
	public Torrent getTorrent() {
		return torrent;
	}
	
	public void setTorrent(Torrent torrent) {
		this.torrent = torrent;
	}

	@Override
	public String toString() {
		return "DisconnectionMessage [torrent=" + torrent + "]";
	}
	
	
	
//TODO: complete if needed!	
	
}
